package guoanmaker.operator.business.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import guoanmaker.operator.business.model.ProvideRoom;

public interface OperatorRoomRepository  extends  JpaRepository<ProvideRoom, String>, JpaSpecificationExecutor<ProvideRoom>{
	/**
	 * lihongyu
	* @Title: findByroomCodes 
	* @Description: TODO(这里用一句话描述这个方法的作用) 
	* @param roomCodes
	* @return    设定文件 
	* @return ProvideRoom    返回类型 
	* @throws 
	 */
	@Query("select u from ProvideRoom u  where u.roomCodes=:roomCodes and u.roomState=2")
 public ProvideRoom findByroomCodes(@Param("roomCodes") String roomCodes);
	/**
	 * lihongyu
	* @Title: findByroomCodesAndcityId 
	* @Description: TODO(这里用一句话描述这个方法的作用) 
	* @param roomCodes
	* @param id
	* @return    设定文件 
	* @return ProvideRoom    返回类型 
	* @throws 
	 */
	@Query("select u from ProvideRoom u left join u.city c where u.roomCodes=:roomCodes and u.roomState=2 and c.id=:id")
	 public ProvideRoom findByroomCodesAndcityId(@Param("roomCodes") String roomCodes,@Param("id") String id);
}
